home *** CD-ROM | disk | FTP | other *** search
- { * This is a test program set up to use the unit "Base".
-
- The whole concept behind this is to make units that "take care of
- themselves"... you use them, and as soon as your program is finished,
- either through a normal termination or a Halt(..), they clean up
- after themselves.
-
- I'm just starting the process of making a bunch of these to make my
- life easier. Look for something that uses GadTools sometime soonish.
-
- Just to note: rather small, isn't it? No need to OpenLibrary yourself
- or anything complex. YES, I got sick of copying my window and screen
- routines around <grin> --- hopefully someone can benefit from my
- laziness ;-)
-
- Written in HighSpeed Pascal 1.10 by Ritchie Annand
- }
-
- program Test;
-
- uses Exec,Graphics,Intuition,Base;
- { ^ Base is our custom unit }
- var
- scr : pScreen; { Pointer to a screen type }
- bwin: pWindow; { A couple of window pointers }
- win : pWindow;
- msg : pMessage; { Pointer to a message type, of course }
- begin
- {--- Use NewScreen routine to open a screen that will be automatically
- taken care of ---}
- scr := NewScreen(640,400,2,HIRES or LACE,'',TRUE);
- {--- Use NewWindow routine to open a borderless window, the size of the
- whole screen, that will be automatically taken care of ---}
- bwin := NewWindow(0,0,640,400,
- 0,BORDERLESS,
- 0,0,0,0,'',scr);
- {--- Use NewWindow to open up a little "Hello" window ---}
- win := NewWindow(0,0,320,200,
- CLOSEWINDOW_,WINDOWCLOSE or WINDOWDRAG,
- 200,100,640,400,'Hello',scr);
- {--- Wait for the user to click on the close gadget ---}
- msg := WaitPort(win^.UserPort);
- end.